

# MMDS Server Console v0.1


# Deleting Student Information from MMDS Database

import sys

import os

import MySQLdb


#Connecting to MMDS Database..

db = MySQLdb.Connect(host="127.0.0.1", port=3306, user="root", passwd="",db="mmds")

cursor = db.cursor()


print "\nWelcome to MMDS Server Console v0.1"

print "\nDeleting Student Information...\n"


userid = raw_input("\n\tEnter the User ID : " )

opt = raw_input("\n\tConfirm Delete? y/n :")


if(opt=='y'):
	
	sql = "Delete from mmds_userinfo where userid = "+userid+" "
	
	
	if(cursor.execute(sql)):
		
		print "\n\tUser Deleted Successfully!...\n\n"
		
	else:
		
		print "\n\tFailed!.. User Not Exist!.. \n\n"
		
		
else:

	print "\n\tAction Cancelled!...\n\n"



db.close()

#Closing Database
